package com.yixiang.np.controller;

import javax.servlet.http.HttpServletRequest;

import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;

import com.alibaba.fastjson.JSON;
import com.alibaba.fastjson.JSONArray;
import com.alibaba.fastjson.JSONObject;
import com.yixiang.np.utils.DateUtil;

@Controller
@RequestMapping("/np")
public class PageController extends BaseController {

    //样例
    @RequestMapping("/test")
    public String test() {
        return "/np/jqgridtest";
    }

    @RequestMapping("/bootstrip")
    public String bootstrip() {
        return "/np/bootstriptest";
    }

    //无权限页面
    @RequestMapping("/nopermission")
    public String nopermission() {
    	return "/np/nopermission";
    }
    //切位合同查询页面
    @RequestMapping("/contractQuery")
    public String contractQuery() {
        return "/np/contractQuery";
    }

    //切位合同查询页面点击查看更多
    @RequestMapping("/lookMore")
    public String lookMore(String payOverTime, HttpServletRequest request) {
        System.out.println(payOverTime);
        if (payOverTime != null && !(payOverTime.equals(""))) {
            request.setAttribute("payOverTime", payOverTime.replace("=", " "));
            System.out.println(payOverTime.replace("=", " "));
        }
        return "/np/contractLookMore";
    }

    //提现审核列表页点击 查看按钮
    @RequestMapping("/toWithdrawDetail/{cashNo}")
    public String toWithdrawDetail(@PathVariable String cashNo) {
        return "/np/withdrawDetail";
    }

    //待出票列表页
    @RequestMapping("/toBeTicketing")
    public String toBeTicketingPage() {
        return "/np/toBeTicketing";
    }

    //出票完成列表页
    @RequestMapping("/toTicketedPage")
    public String toTicketedPage() {
        return "/np/ticketedPage";
    }

    //跳转到-->出票信息页面
    @RequestMapping("/toTicketInfo")
    public String toTicketInfo() {
        return "/np/ticketInfo";
    }

    //跳转到-->出票管理
    @RequestMapping("/toTicketManage")
    public String toTicketManage() {
        return "/np/ticketManage";
    }

    //交易记录列表
    @RequestMapping("/tradeListPage")
    public String tradeListPage() {
        return "/np/tradeListPage";
    }

    /**
     * 账户充值审核列表
     *
     * @param b
     * @param request
     * @return
     */
    @RequestMapping(value = "/checkPageInc")
    public String checkManage(String b, HttpServletRequest request) {
        return "/np/checkPageInc";
    }

    //点击航班数显示预定的航班信息
    @RequestMapping(value = "/showFlights")
    public String showFlights(String b, HttpServletRequest request) {
        return "/np/showFlights";
    }

    /**
     * 账户提现审核列表
     *
     * @param b
     * @param request
     * @return
     */
    @RequestMapping(value = "/checkPageCost")
    public String checkCostManage(String b, HttpServletRequest request) {
        return "/np/checkPageCost";
    }

    //跳转充值记录列表
    @RequestMapping("/toRechargePage")
    public String toRechargePage() {
        return "/np/rechargeRecord";
    }

    //提现付款跳转页面
    @RequestMapping("/toPaymentPage/{cashNo}")
    public String toPaymentPage(@PathVariable String cashNo) {
        return "/np/checkPaymentCost";
    }

    //跳转提现记录列表
    @RequestMapping("/toWithdrawPage")
    public String toWithdrawPage() {
        return "/np/withdrawRecord";
    }

    /**
     * 充值填写
     */
    @RequestMapping(value = "/tradeRecharge")
    public String tradeRecharge(String b, HttpServletRequest request) {
        return "/np/tradeRecharge";
    }

    /**
     * 充值审核填写
     */
    @RequestMapping(value = "/checkPage/{id}")
    public String checkPage(@PathVariable String id) {
        return "/np/checkPage";
    }

    /**
     * 充值审核-查看详情
     */
    @RequestMapping(value = "/checkPageDetail/{id}")
    public String checkPageDetail(@PathVariable String id) {
        return "/np/checkPageDetail";
    }

    /**
     * 提现审核填写
     */
    @RequestMapping(value = "/checkPageTX/{id}")
    public String checkPageTX(@PathVariable String id) {
        return "/np/checkPageTX";
    }

    /**
     * 提现审核詳情
     */
    @RequestMapping(value = "/checkTXDetail/{id}")
    public String checkTXDetail(@PathVariable String id) {
        return "/np/checkTXDetail";
    }
    
    //购商账务报表页面
    @RequestMapping(value = "/purRepPage")
    public String purRepPage() {
        return "/np/purRepPage";
    }

    //采购商押金报表
    @RequestMapping(value = "/despRepPage")
    public String despRepPage() {
        return "/np/despRepPage";
    }

    //主页
    @RequestMapping("/main")
    public String main() {
        return "/np/main";
    }
  
    /**
     * 账户充值审核列表
     * @param b
     * @param request
     * @return
     */
    /**
     * 点击提现
     */
    @RequestMapping(value = "/withdraw")
    public String withdraw() {
        return "/np/withdrawDailog";
    }

    /**
     * 待出票-出票填写
     */
    @RequestMapping(value = "/orderPassengerWait/{orderNumber}")
    public String orderPassengerWait(@PathVariable String orderNumber) {
        return "/np/orderPassengerWait";
    }

    /**
     * 运营商-合同订单查询页面
     */
    @RequestMapping(value = "/contractForPlatform")
    public String contractForPlatform() {
        return "/np/contractListForPlat";
    }

    /**
     * 业务报表页面
     */
    @RequestMapping(value = "/reportForSeller")
    public String reportForSeller() {
        return "/np/reportListForSeller";
    }

    /**
     * 运营商-合同订单查询页面点击查看详情
     */
    @RequestMapping(value = "/contractDetailForPlatform")
    public String contractDetailForPlatform(String paymentOverTime, HttpServletRequest request) {
        System.out.println(paymentOverTime);
        if (paymentOverTime != null && !(paymentOverTime.equals(""))) {
            request.setAttribute("payOverTime", paymentOverTime.replace("=", " "));
            System.out.println(paymentOverTime.replace("=", " "));
        }
        return "/np/contractDetailForPlat";
    }

    /**
     * 测试用
     */
    @RequestMapping(value = "/forTest")
    public String forTest() {
        return "/np/test";
    }

    /**
     * 跳转到佣金账期列表页
     */
    @RequestMapping(value = "/chargesList")
    public String toChargesList() {
        return "/np/chargesAndCreditList";
    }

    /**
     * 跳转到编辑佣金账期页
     */
    @RequestMapping(value = "/editCharges")
    public String toEditCharges() {
        return "/np/editChargesAndCredit";
    }

    /**
     * 供應商信息修改
     *
     * @return
     */
    @RequestMapping(value = "/supplierEdit")
    public String supplierEdit() {
        return "/np/supplierEdit";
    }

    /**
     * 採購商信息修改
     *
     * @return
     */
    @RequestMapping(value = "/purchaseEdit")
    public String purchaseEdit() {
        return "/np/purchaseEdit";
    }

    @RequestMapping(value = "/contractLog")
    public String contractLog() {
        return "/np/contractLog";
    }

    @RequestMapping(value = "/notice")
    public String notice() {
        return "/admin/notice";
    }

    @RequestMapping(value = "/noticeAdd")
    public String noticeAdd() {
        return "/admin/noticeAdd";
    }

    @RequestMapping(value = "/buyerList")
    public String buyerList() {
        return "/np/buyerList";
    }

    @RequestMapping(value = "/buyerAudit/{id}")
    public String buyerAudit(@PathVariable Long id) {
        return "/np/buyerAudit";
    }

    @RequestMapping(value = "/toUnticketed")
    public String toUnticketed() {
        return "/np/unticketedPage";
    }
    @RequestMapping(value = "/orderPassengerImp")
    public String orderPassengerImp() {
        return "/np/orderPassengerImp";
    }
    @RequestMapping(value = "/toEditPassengerInfo/{orderNumber}")
    public String toEditPassengerInfo(@PathVariable String orderNumber){
        return "/np/editPassengerInfo";
    }

    //商家管理  -- 渠道管理
    @RequestMapping(value = "/toChannelManage")
    public String channelManage(){
        return "/np/channelManage";
    }
    @RequestMapping(value = "/toEditChannel")
    public String toEditChannel(){
        return "/np/editChannelManage";
    }
}
